import request from '@/utils/request'
//加入购物车
export const addCartApi=(skuId,count)=>{
    return request.post('/member/cart',{
        skuId,
        count
    })
}
//删除购物车
export const deleteCart=(ids)=>{
    return request.delete('/member/cart',{
        data:{
            ids
        }
    })
}
//获取购物车列表
export const getCartList=()=>{
    return request.get('/member/cart')
}
//修改购物车
export const updateCart=(skuId,params)=>{
    return request.put(`/member/cart/${skuId}`,
        params
    )
}
//修改购物车全选/取消
export const updateCartAll=(selected,ids)=>{
    return request.put(`/member/cart/selected`,
        {
            selected,
        ids
        }
    )
}
//合并购物车
export const mergeCart=(data)=>{
   return request({
    url:'/member/cart/merge',
    method:'post',
    data
    
   })
}